public class Main {

    public static void main(String[] args) {
        Addn addn = new Addn();

        Thread[] all = new Thread[10];

        for(int i=0; i<10; i++)
        {
            all[i] = new Thread(addn);
            all[i].start();
        }
        try {
            for(int i=0; i<10; i++)
            {
                all[i].join();
            }
        } catch (InterruptedException e)
        {
            e.printStackTrace();
        }

        System.out.println("sum=："+Addn.getSum());
    }

}

